#include "HexObserver.hpp"
#include "Observer.cpp"
#include "ObservedObject.cpp"
#include <iostream>
#include <stdlib.h>

using namespace std;

HexObserver::HexObserver(ObservedObject<int> *observedObject) : Observer<int>(observedObject) {}

void HexObserver::notify()
{
    char bin_string[100] = {0};
    itoa(observedObject->getValue(), bin_string, 16);
    cout << "16进制：0x" << bin_string << endl;
}